package br.com.infocruz.seam.crm.ejb.session;

import br.com.infocruz.seam.crm.ejb.model.*;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.framework.EntityHome;

@Name("addressHome")
public class AddressHome extends EntityHome<Address> {

	public void setAddressId(Long id) {
		setId(id);
	}

	public Long getAddressId() {
		return (Long) getId();
	}

	@Override
	protected Address createInstance() {
		Address address = new Address();
		return address;
	}

	public void load() {
		if (isIdDefined()) {
			wire();
		}
	}

	public void wire() {
		getInstance();
	}

	public boolean isWired() {
		return true;
	}

	public Address getDefinedInstance() {
		return isIdDefined() ? getInstance() : null;
	}

}
